Skip to content

✨ Addons: Add functionality for resolveConflicts: PRESERVE #5330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

edmondceausu
Copy link

@edmondceausu edmondceausu commented Feb 3, 2025

What type of PR is this?
/kind feature

What this PR does / why we need it:

Added support for resolveConflicts.PRESERVE (API Reference). This is helpful if users are migrating an existing cluster to Cluster API and do not have their existing Addon Configs specified, or if an out of band change is made to an Addon (eg. configMap change) and the user wants to preserve it.

The schema for conflictResolution had listed none as the default behavior. I updated the docs and code to reflect that.
*
Special notes for your reviewer*:

Checklist:

  • squashed commits
  • includes documentation
  • includes emoji in title
  • adds unit tests
  • adds or updates e2e tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 3, 2025
Copy link

linux-foundation-easycla bot commented Feb 3, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @edmondceausu!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 3, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @edmondceausu. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 3, 2025
@edmondceausu edmondceausu changed the title Addons: Add functionality for resolveConflicts: PRESERVE ✨ Addons: Add functionality for resolveConflicts: PRESERVE Feb 3, 2025
@nrb
Copy link
Contributor

nrb commented Feb 4, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 4, 2025
@nrb
Copy link
Contributor

nrb commented Feb 4, 2025

Thanks for this!

Overall, this looks good to me. The tests are currently failing because make generate needs to be run and the results committed, and it looks like the linter's finding an unnecessary newline.

Once those are fixed (and it passes e2es), I think we're good!

@edmondceausu
Copy link
Author

/retest

@edmondceausu
Copy link
Author

/test pull-cluster-api-provider-aws-test

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-e2e

Copy link
Member

@richardcase richardcase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @edmondceausu . Just the one small comment.


// AddonResolutionPreserve indicates that if there are parameter conflicts then
// resolution will result in preserving the existing value
AddonResolutionPreserve = AddonResolution("preserve")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes should only be added to the latest API types only (i.e. v1beta2). Can you remove this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@edmondceausu edmondceausu force-pushed the addons-preserve branch 2 times, most recently from 924b7be to 925b5d4 Compare April 6, 2025 18:49
@edmondceausu
Copy link
Author

/test pull-cluster-api-provider-aws-e2e

1 similar comment
@damdo
Copy link
Member

damdo commented Apr 10, 2025

/test pull-cluster-api-provider-aws-e2e

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 13, 2025
@richardcase
Copy link
Member

/test ?

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Apr 18, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from nrb. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@edmondceausu
Copy link
Author

Forgot to update the addons struct kubebuilder to enable access to the preserve function

@edmondceausu
Copy link
Author

/test pull-cluster-api-provider-aws-e2e

@edmondceausu
Copy link
Author

/retest

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/contains-merge-commits and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 22, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed do-not-merge/contains-merge-commits cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 23, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 29, 2025
@edmondceausu
Copy link
Author

/test pull-cluster-api-provider-aws-e2e

@edmondceausu
Copy link
Author

/retest

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-e2e-eks

@nrb
Copy link
Contributor

nrb commented May 12, 2025

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 12, 2025
preserve
```

_Note_: For `conflictResolution` `none` is the **default** behaviour. That means, if not otherwise specified, it's
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused - it looks like the GoDoc and YAML previously stated that the default was none, but that was incorrect according to the actual kubebuilder validation rule. The book documentation was correct, though, and this particular change changes that.

Am I missing something in my reading?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. I had updated the docs on my first review of the feature, but later updated the behavior to reflect what was in the kubebuilder validation rule. I restored the book doc to reflect what is in kubebuilder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants